import type { PageParams, PageResult } from '@/types/grobal'
import type { BannerItem, CategoryItem, GuessItem, HotItem } from '@/types/home'
import { request } from '@/utils/request'

// 首页-广告轮播图
export const getBannerAPI = (distributionSite: number = 1) => {
  return request<BannerItem[]>({
    method: 'GET',
    url: `/home/banner?distributionSite=${distributionSite}`,
  })
}
// 首页-分类
export const getCategoryAPI = () => {
  return request<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
// 首页-热门推荐
export const getHotAPI = () => {
  return request<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
// 首页-猜你喜欢
export const getGuessLikeAPI = (data?: PageParams) => {
  return request<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
